---
title: Static Export
description: Enable static export with Fumadocs
---

## Overview

Fumadocs is fully compatible with Next.js static export, allowing you to export the app as a static HTML site without a Node.js server.

```js title="next.config.mjs"
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  output: 'export',

  // Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
  // trailingSlash: true,

  // Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
  // skipTrailingSlashRedirect: true,
};
```

See [Next.js docs](https://nextjs.org/docs/app/guides/static-exports) for limitations and details.

## Search

### Cloud Solutions

Since the search functionality is powered by remote servers, static export works without configuration.

### Built-in Search

You need to:

1. Build the search indexes statically using [`staticGET`](/docs/headless/search/orama#static-export).
2. Enable static mode on search client from Root Provider:

   ```tsx title="app/layout.tsx"
   import { RootProvider } from 'fumadocs-ui/provider';
   import type { ReactNode } from 'react';

   export default function RootLayout({ children }: { children: ReactNode }) {
     return (
       <html lang="en" suppressHydrationWarning>
         <body>
           <RootProvider
             search={{
               options: {
                 type: 'static', // [!code highlight]
               },
             }}
           >
             {children}
           </RootProvider>
         </body>
       </html>
     );
   }
   ```

This allows the route handler to be statically cached into a single file, and search will be computed on browser instead.
